/**
 * 
 */
package com.myBase.core.dao;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.myBase.core.entity.GoldcoinTradeRecord;
import com.myBase.common.persistence.CrudDao;
import com.myBase.common.persistence.annotation.MyBatisDao;

/**
 * 用户金币获取、消费、过期相关流水DAO接口
 * @author WuJie
 * @version 2017-05-04
 */
@MyBatisDao
public interface GoldcoinTradeRecordDao extends CrudDao<GoldcoinTradeRecord> {

    /**
     * * getGoldRecordList(查询金币获取，使用，过期流水) 
     */
    public List<HashMap<String, Object>> getGoldRecordList(GoldcoinTradeRecord goldRecord);

    /**
     * * getGoldRecordCount(查询金币获取，使用，过期流水 总数) 
     */
    public int getGoldRecordCount(GoldcoinTradeRecord goldRecord);

    /**
     * * getGoldRecordSum(营销 活动资金   查询发出,使用,过期金币) 
     * @param  activityId
     * @return HashMap   
     */
    public HashMap<String, Object> getGoldRecordSum(int activityId);

    /**
     * * getGoldRecordSumByUserId(pc 我的金币 查询已使用，已过期金币数量) 
     * @param   GoldcoinTradeRecord
     * @return  HashMap
     */
    public HashMap<String, Object> getGoldRecordSumByUserId(GoldcoinTradeRecord goldRecord);

    /**
     * getGoldCoinActivityCoinSumByDate 指定日期，指定branchid，指定活动发出金币数
     * @param activityIds
     * @param brancheId
     * @param minDate
     * @param maxDate
     * @return
     */

    public ArrayList<Map<String, Object>> getGoldCoinActivityCoinSumByDate(@Param("activityIds") String activityIds,
            @Param("branchId") String branchId, @Param("minDate") String minDate, @Param("maxDate") String maxDate);

    /**
     * * findUserGoldGainList(用户金币领取查询) 
     * @param   GoldcoinTradeRecord
     * @return List<GoldcoinTradeRecord>  
     */
    public List<GoldcoinTradeRecord> findUserGoldGainList(GoldcoinTradeRecord goldRecord);

    /**
     * * findUserGoldOverdueList(用户金币过期查询) 
     * @param   GoldcoinTradeRecord
     * @return List<GoldcoinAccountDetail> 
     */
    public List<GoldcoinTradeRecord> findUserGoldOverdueList(GoldcoinTradeRecord goldRecord);

    /**
     * * getUserGoldCountByEquipment(用户金币过期查询 根据设备分组) 
     * @param   GoldcoinTradeRecord
     * @return List<HashMap<String,Object>>   
     */
    public List<HashMap<String, Object>> getUserGoldCountByEquipment(GoldcoinTradeRecord goldRecord);

    /**
     * * getUserGoldCount(用户金币过期查询,总人数和总过期金币数量) 
     * @param   GoldcoinTradeRecord
     * @return  HashMap
     */
    public HashMap<String, Object> getUserGoldCount(GoldcoinTradeRecord goldRecord);

    /**
     * getGoldCoinActivityIdListByDate 指定日期，指定平台来源，获取有金币发放记录的activityid
     * @param brancheId
     * @param minDate
     * @param maxDate
     * @return
     */
    public ArrayList<Map<String, Object>> getGoldCoinActivityIdListByDate(@Param("branchId") String branchId,
            @Param("minDate") String minDate, @Param("maxDate") String maxDate);
    
    /**
     * 获取指定用户（accountid）和指定领取金币批次（detailid）且是发放金币的 GoldcoinTradeRecord 数据实体list
     * @param accountId
     * @param detailId
     * @return
     */
    public ArrayList<GoldcoinTradeRecord> getBeanListByDetailIdAccountIdSend(@Param("accountId") String accountId, @Param("detailId") String detailId);
}
